﻿<Window x:Class="SmartText.OptionWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{DynamicResource setting_window}"
        xmlns:sys="clr-namespace:System;assembly=mscorlib" Width="300"
        ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
        ResizeMode="NoResize" SizeToContent="Height"
        Icon="/SmartText;component/st.ico">
    <Window.Resources>
        <DataTemplate x:Key="encodingTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=EncodingName}" Width="250" />
                <TextBlock Text="{Binding Path=CodePage}" />
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    <Grid x:Name="grd" Background="{StaticResource ControlBackgroundBrush}" Grid.IsSharedSizeScope="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <GroupBox Grid.Row="0" Margin="3"  Header="{DynamicResource encoding}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Label" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Grid.Row="0" Margin="3"
                        FontWeight="Bold" VerticalAlignment="Center"
                        HorizontalAlignment="Right"
                        Text="{DynamicResource template_file}"></TextBlock>
                <ComboBox x:Name="cboTemplateEnc" Grid.Column="1" Grid.Row="0"
                        Margin="3"
                        ItemTemplate="{StaticResource encodingTemplate}"
                        SelectedValue="{Binding Path=TemplateEncoding}" />
                <TextBlock Grid.Column="0" Grid.Row="1" Margin="3"
                        FontWeight="Bold" VerticalAlignment="Center"
                        HorizontalAlignment="Right"
                        Text="{DynamicResource parameter_file}"></TextBlock>
                <ComboBox x:Name="cboParamEnc" Grid.Column="1" Grid.Row="1"
                        Margin="3"
                        ItemTemplate="{StaticResource encodingTemplate}"
                        SelectedValue="{Binding Path=ParamEncoding}" />
                <TextBlock Grid.Column="0" Grid.Row="2" Margin="3"
                        FontWeight="Bold" VerticalAlignment="Center"
                        HorizontalAlignment="Right"
                        Text="{DynamicResource output_file}"></TextBlock>
                <ComboBox x:Name="cboOutputEnc" Grid.Column="1" Grid.Row="2"
                        Margin="3"
                        ItemTemplate="{StaticResource encodingTemplate}"
                        SelectedValue="{Binding Path=OutputEncoding}" />
            </Grid>
        </GroupBox>
        <GroupBox Grid.Row="1" Margin="3"  Header="Language">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Label" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Margin="3" FontWeight="Bold"
                        VerticalAlignment="Center" HorizontalAlignment="Right"
                        Text="Language:"></TextBlock>
                <ComboBox x:Name="cboLang" Grid.Column="1" Margin="3"
                        DisplayMemberPath="Language"
                        SelectedValue="{Binding Path=LangInfo}"></ComboBox>
            </Grid>
        </GroupBox>
        <Grid Grid.Row="4" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Button x:Name="btnOK" Grid.Column="0" Margin="10" Padding="5"
                    IsDefault="True" Click="btnOK_Click"
                    Content="{DynamicResource ok}"></Button>
            <Button x:Name="btnCancel" Grid.Column="1" Padding="5" Margin="10"
                    IsCancel="True" Content="{DynamicResource cancel}"></Button>
        </Grid>
    </Grid>
</Window>